package com.milhouz.wormdroid.gl.renderer;

import java.util.ArrayList;

import javax.microedition.khronos.opengles.GL10;

import com.milhouz.wormdroid.gl.model.GLSprite;
import com.milhouz.wormdroid.gl.model.hud.IHudSprite;

/**
 * A generic renderer interface.
 */
public interface Renderer {

	/**
	 * @return the EGL configuration specification desired by the renderer.
	 */
	int[] getConfigSpec();

	/**
	 * Surface created. Called when the surface is created. Called when the application starts, and whenever the GPU is reinitialized. This will
	 * typically happen when the device awakes after going to sleep. Set your textures here.
	 */
	void surfaceCreated(GL10 gl);

	/**
	 * Called when the rendering thread is about to shut down. This is a good place to release OpenGL ES resources (textures, buffers, etc).
	 * 
	 * @param gl
	 */
	void shutdown(GL10 gl);

	/**
	 * Surface changed size. Called after the surface is created and whenever the OpenGL ES surface size changes. Set your viewport here.
	 * 
	 * @param gl
	 * @param width
	 * @param height
	 */
	void sizeChanged(GL10 gl, int width, int height);

	/**
	 * Draw the current frame.
	 * 
	 * @param gl
	 */
	void drawFrame(GL10 gl, int width, int height);

	void moveCamera(int dx, int dy);

	void moveCameraWithSprite(GLSprite sprite);

	void centerCameraOnSprite(GLSprite sprite);

	GLSprite getSpriteById(int idSprite);

	ArrayList<GLSprite> getSprites();

	void setZoom();

	boolean isZoomed();

	public void setSprites(ArrayList<GLSprite> sprites);

	public void setHudSprites(ArrayList<IHudSprite> sprites);

	public void setScreenDimension(int width, int height);

}
